package com.zc.operator.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zc.operator.mapper.ChargeStationDeviceExtendMapper;
import com.zc.operator.domain.ChargeStationDeviceExtend;
import com.zc.operator.service.IChargeStationDeviceExtendService;

/**
 * 场站设备关联Service业务层处理
 *
 * @author glb
 * @date 2024-02-03
 */
@Service
public class ChargeStationDeviceExtendServiceImpl implements IChargeStationDeviceExtendService
{
    @Autowired
    private ChargeStationDeviceExtendMapper chargeStationDeviceExtendMapper;

    /**
     * 查询场站设备关联
     *
     * @param deviceId 场站设备关联主键
     * @return 场站设备关联
     */
    @Override
    public ChargeStationDeviceExtend selectChargeStationDeviceExtendByDeviceId(String deviceId)
    {
        return chargeStationDeviceExtendMapper.selectChargeStationDeviceExtendByDeviceId(deviceId);
    }

    /**
     * 查询场站设备关联列表
     *
     * @param chargeStationDeviceExtend 场站设备关联
     * @return 场站设备关联
     */
    @Override
    public List<ChargeStationDeviceExtend> selectChargeStationDeviceExtendList(ChargeStationDeviceExtend chargeStationDeviceExtend)
    {
        return chargeStationDeviceExtendMapper.selectChargeStationDeviceExtendList(chargeStationDeviceExtend);
    }

    /**
     * 新增场站设备关联
     *
     * @param chargeStationDeviceExtend 场站设备关联
     * @return 结果
     */
    @Override
    public int insertChargeStationDeviceExtend(ChargeStationDeviceExtend chargeStationDeviceExtend)
    {
        chargeStationDeviceExtend.setCreateTime(DateUtils.getNowDate());
        return chargeStationDeviceExtendMapper.insertChargeStationDeviceExtend(chargeStationDeviceExtend);
    }

    /**
     * 修改场站设备关联
     *
     * @param chargeStationDeviceExtend 场站设备关联
     * @return 结果
     */
    @Override
    public int updateChargeStationDeviceExtend(ChargeStationDeviceExtend chargeStationDeviceExtend)
    {
        chargeStationDeviceExtend.setUpdateTime(DateUtils.getNowDate());
        return chargeStationDeviceExtendMapper.updateChargeStationDeviceExtend(chargeStationDeviceExtend);
    }

    /**
     * 批量删除场站设备关联
     *
     * @param deviceIds 需要删除的场站设备关联主键
     * @return 结果
     */
    @Override
    public int deleteChargeStationDeviceExtendByDeviceIds(String[] deviceIds)
    {
        return chargeStationDeviceExtendMapper.deleteChargeStationDeviceExtendByDeviceIds(deviceIds);
    }

    /**
     * 删除场站设备关联信息
     *
     * @param deviceId 场站设备关联主键
     * @return 结果
     */
    @Override
    public int deleteChargeStationDeviceExtendByDeviceId(String deviceId)
    {
        return chargeStationDeviceExtendMapper.deleteChargeStationDeviceExtendByDeviceId(deviceId);
    }
}
